'use strict'

const Controller = require('egg').Controller

class HomeController extends Controller {
  async index() {
    const { ctx, app } = this

    const data = await app.mysql.select('blogs')
    ctx.body = new ctx.SuccessModel(data)
  }

  // this.
  async uploadFile() {
    const { ctx, app } = this
    const files = ctx.request.files

    ctx.body = new ctx.SuccessModel(files)
  }
}

module.exports = HomeController
